package com.test.qrcode.manage.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * @program qrcode
 * @Title: WebContextUtil
 * @description: Web上下文工具类
 * @author: XueXiao
 * @create: 2019-02-28 09:25:45
 */
public class WebContextUtil {
    /** 
    * @Description: 获取HTTP请求
    * @Author: XueXiao 
    * @Date: 2019/2/28 09:40
    */ 
    public static HttpServletRequest getRequest() {
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder
                .getRequestAttributes()).getRequest();
        return request;
    }
}
